<template>
	<view class="content">
		<top-login :navTitle='navTitle'></top-login>

		<view class="about">

			<view class="aaa">
				<view class="title" v-if="info.title != ''">{{ info.title }}</view>
				<view class="time" v-if="info.create_time_text != ''">{{ info.create_time_text }}</view>

				<view class="p">
					<u-parse class="nodes" :content="info.content"></u-parse>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import topLogin from '@/components/topLog.vue';
	export default {
		components: {
			topLogin
		},
		data() {
			return {
				type: '',
				navTitle: 'Index',
				id: 0,
				info: {
					title: '',
					create_time_text: '',
					content: ''
				},
				t: ''
			};
		},
		onLoad(options) {
			this.type = options.type
			this.id = options.id || 0
			this.t = options.t
			this.getInfo();
		},
		methods: {
			getInfo() {
				if (this.type == 'notice') {
					this.info.content = this.vuex_theme.notice_content
					this.$API.getNoticeInfo({
						id: this.id
					}).then(res => {
						this.info = res.data
					}).catch(err => {

					})
				} else if (this.type == 'agreement') {
					if (this.t == 2) {
						this.info.content = this.vuex_theme.agreement;
					}
					if (this.t == 1) {
						this.info.content = this.vuex_theme.private_agreement;
					}
					if (this.t == 3) {
						this.info.content = this.vuex_theme.partner_agreement;
					}
				} else if (this.type == 'About') {
					this.navTitle = this.type
					this.type = 'notice'
					this.info.content = this.vuex_theme.about
				} else if (this.type == 'banner') {
					this.$API.getBannerInfo({
						id: this.id
					}).then(res => {
						this.info = res.data
					}).catch(err => {

					})
				} else {

				}
			}
		}
	}
</script>

<style lang="scss">
	.content {
		@include flex(column);
		align-items: center;
		justify-content: center;
		margin: 0 36rpx;
		flex: 1;
		overflow-x: hidden;

		.about {
			padding: 0rpx 40rpx;
			width: 100%;
			display: flex;

			.aaa {
				padding: 50rpx 40rpx;
				background-color: #fff;
				border-radius: 48rpx;
				margin: 36rpx 0 36rpx;
				width: 100%;
			}

			.title {
				width: 582rpx;
				height: 36rpx;
				display: inline-block;
				font-size: 36rpx;
				font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
				font-weight: bold;
				color: #110202;
			}

			.time {
				width: 582rpx;
				height: 28rpx;
				display: inline-block;
				font-size: 28rpx;
				font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
				font-weight: 400;
				color: #110202;
				line-height: 28rpx;
				margin: 32rpx 0;
			}
		}
	}
</style>